import { View, Text } from 'react-native'
import React, { useState } from 'react'
import { StyleSheet } from 'react-native'
import ZhTab0 from './ZhTab0'
import ZhTab1 from './ZhTab1'
import ZhTab2 from './ZhTab2'

export default function ZhTabsBody({num}) {
  //父组件通过props传递给子组件的数据天然具备“响应式”特征
  return (
    <View style={ss.body}>
      <View style={{display: num===0?'flex':'none', flex:1}}>
        <ZhTab0/>
      </View>
      <View style={{display: num===1?'flex':'none', flex:1}}>
        <ZhTab1/>
      </View>
      <View style={{display: num===2?'flex':'none', flex:1}}>
        <ZhTab2/>
      </View>
    </View>
  )
}

let ss = StyleSheet.create({
  body: {
    flex:1, //尺寸增长权重：1
  },
})